from sqlalchemy import Column, ForeignKey, Integer, Table

from app.database.models.base import Base

orders_proxies = Table(
    "orders_proxies",
    Base.metadata,
    Column("order_id", Integer, ForeignKey("order.id")),
    Column("proxy_id", Integer, ForeignKey("proxy.id")),
)

sites_categories = Table(
    "sites_categories",
    Base.metadata,
    Column("category_id", Integer, ForeignKey("category.id")),
    Column("site_id", Integer, ForeignKey("site.id")),
)

server_categories = Table(
    "server_categories",
    Base.metadata,
    Column("category_id", Integer, ForeignKey("category.id")),
    Column("server_id", Integer, ForeignKey("server.id")),
)

proxies_users = Table(
    "proxies_users",
    Base.metadata,
    Column("proxy_id", Integer, ForeignKey("proxy.id")),
    Column("user_id", Integer, ForeignKey("user.id")),
)

allowed_ips_orders = Table(
    "allowed_ips_orders",
    Base.metadata,
    Column("allowed_ip_id", Integer, ForeignKey("allowed_ip.id")),
    Column("order_id", Integer, ForeignKey("order.id")),
)
